<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
	<meta charset="utf-8">
	<title>head</title>
	<link href="css/global.css" rel="stylesheet" type="text/css">
	<link href="css/head.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>
	<script type="text/javascript" src="js/yhj_head.js"></script>
  </head>
  
  <body>
    <div class="yhj_head">
    	<div class="yhj_head_logo">
        	<img class="yhj_head_logo_img"/ src="images/yhj_20150901105929.png" title="戳我~我是首页" onClick="javascript:parent.location.href='index.jsp';"/>
        </div>
        <div class="yhj_head_search"><!--target的意思是，当使用的是iframe时，可以调用到iframe的父级窗口来action
        	<form action="search.html" method="post" id="yhj_search_form" target="_parent"><!--可能中间还要加类型之类的选项-->
                <input type="search" placeholder="最近大家都在搜”同游“" class="yhj_head_search_input"/>
                <input type="button" class="yhj_head_search_button" value="    搜索" onClick="submit()"/>
           		<!--用session 或 json  传参-->
            </form>
        </div>
        
        
        
        
        <div class="yhj_head_info"   style="display:none;"><!--通过class取第0个  用户未登录前的页面 -->
        	<ul class="yhj_head_info_menu">
            	<li onClick="parent.location.href='index.jsp'">首页<p></p></li>
                <li class="yhj_head_info_li">我帮你<span class="yhj_head_info_ul_li_down"></span>
                	<p><a href="javascript:parent.location.href='backcust/personinfo.jsp'">用户中心</a></p>
                    <p><a href="javascript:parent.location.href='backcust/manage.jsp'">任务管理</a></p>
                </li>
                <!-- <li class="yhj_head_info_li">求帮助<span class="yhj_head_info_ul_li_down"></span>
                	<p><a href="#">菜单1</a></p>	
                    <p><a href="#">菜单2</a></p>
                    <p><a href="#">菜单3</a></p>
                </li>  -->
                
                <li onClick="parent.location.href='Login.jsp'">注册<p></p></li>
                <li style="height:33px; width:1px; background:#4b4b4b;"></li><!--中间的竖线-->
                <li onClick="parent.location.href='Login.jsp'">登录<p></p></li>
            </ul>
        </div>
        
        
        
        
        
        
        <div class="yhj_head_info" style="display:none;">
        	<ul class="yhj_head_info_menu">
                <li id="yhj_username" ">${sessionScope.userinfosession.ualais}</li><!-- 用户登录后的页面     大于四个中文或者   应该设置大于9个字符就显示隐藏-->
                <li class="yhj_head_info_li">我的信息<span class="yhj_head_info_ul_li_down"></span>
                	<p><a href="javascript:parent.location.href='backcust/personinfo.jsp'">用户中心</a></p>
                    <p><a href="javascript:parent.location.href='backcust/manage.jsp'">任务管理</a></p>
                </li>
                <li class="yhj_head_info_li">操作<span class="yhj_head_info_ul_li_down"></span>
                	 <p><a href="javascript:userlogout()">注销</a></p>
                </li>
                <!-- 
                <li class="yhj_head_info_li">我帮你<span class="yhj_head_info_ul_li_down"></span>
                	<p><a href="asdfsd">任务查询</a></p>
                    <p><a href="#">我的关心</a></p>
                    <p><a href="#">关注任务</a></p>
                </li>
                <li class="yhj_head_info_li">求帮助<span class="yhj_head_info_ul_li_down"></span>
                	<p><a href="#">菜单1</a></p>	
                    <p><a href="#">菜单2</a></p>
                    <p><a href="#">菜单3</a></p>
                </li>
                 -->
            	<li onClick="parent.location.href='index.jsp'">首页<p></p></li>                
            </ul>
        </div>
    </div>
    
    
    
    
    
    
    
    
    
    <script type="text/javascript">
    	//var user=${sessionScope.userinfosession};
    	//alert("${sessionScope.userinfosession.ualais}");
    	if(""=="${sessionScope.userinfosession.ulogon}"){//利用账户的账号，判断是否有用户登录
    		//没有用户登录
    		$(".yhj_head_info").first().css("display","block");
    		
    	}else{
    		//用户已经登录 
    		$(".yhj_head_info").last().css("display","block");
    		if($(window.parent.yhj_quickregister)){
        		$(window.parent.yhj_quickregister).css("display","none");
    		}
    	}
    	
    	
    	//用户注销操作
    	function userlogout(){
    		//window.parent.window.showinfobox(2,"","已经成功登出"); 调用父类方法测试已通过
    		$.ajax({
    			type:"POST",
    			url:"cust.action?op=userlogout",
    			dataType:"JSON",
    			success:function(data){
    				if(data.code==1){
    					//成功登出了，弹出提示，并修改界面内容
    					$(".yhj_head_info").first().css("display","block");
    					$(".yhj_head_info").last().css("display","none");
    					//window.parent.window.showinfobox(2,"","已经成功登出"); 
    					var quickregister=$(window.parent.yhj_quickregister);
    					if(quickregister){
    						quickregister.slideDown("fast");
    					}
    					if($(window.parent.yhj_content_maincontent_right_userinfo)){
    						$(window.parent.yhj_content_maincontent_right_userinfo).slideUp("fast");
    					}
    					if($(window.parent.yhj_content_maincontent_center_quicksend)){
    						$(window.parent.yhj_content_maincontent_center_quicksend).slideUp("fast");
    					}
    					window.parent.location.href="index.jsp";
    				}else{
    					window.parent.window.showinfobox(2,"",data.msg);
    					window.location.reload();
    				}
    			}
    		});
    	}
    	
    	
    </script>
  </body>
</html>
